<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
class District extends Model
{
    // 表名称
    protected $table = 'district';
    // 开启自动时间戳
    public $timestamps = true;
    // 日期都存储为时间戳
    protected $dateFormat = 'U';

	public function getCity()
    {
        return $this->hasOne('App\City', 'code', 'citycode');
    }

    public function  getCafe(){
		return $this->hasMany('App\Cafe','adcode','adcode');
	}
}
